<?php $__env->startSection('title'); ?><?php echo $title; ?> <?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?> 
     
     <?php 
     
     $trueProfile = true; 
     $page = Input::get('page');
	 
     // ** Admin Settings ** //
     $settings = AdminSettings::first();
	 
	 // ** Sql Query ** //
		 
		 $sql   = DB::table('members')
		 ->select(DB::raw('
		count(DISTINCT followers.id) totalFollowers,
		count(DISTINCT shots.id) totalShots,
		members.id,
		members.username,
		members.name,
		members.location,
		members.hire,
		members.avatar,
		members.status,
		members.type_account,
		shots.image,
		shots.title,
		shots.id id_shot
		'))
		->leftjoin('followers', 'members.id', '=', DB::raw('followers.following AND followers.status = "1"'))
		->leftjoin('followers as F', 'members.id', '=', DB::raw('F.follower AND F.status = "1"'))
		->leftjoin('shots', 'members.id', '=', DB::raw('shots.user_id AND shots.status = "1"'))
		->where('F.following', '=', $user->id )
		->where('members.status', '=', 'active')
		->groupBy('members.id')
		->orderBy('F.id', 'DESC')
		->paginate( $settings->result_request );
		 

     ?>
     
     <?php echo $__env->make('includes.cover-static', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
     
     	<!-- Col MD -->
<div class="col-md-8">	

	
<h1 class="title-item none-overflow">
	<?php echo Lang::get('users.followers'); ?> <small>(<?php echo Helper::formatNumber( User::totalFollowers( $user->id ) ); ?>)</small>

	</h1> 

<hr />
     
     <?php foreach( $sql as $designer ): ?>	
     
     <?php echo $__env->make('includes.users-list', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
     
    		<?php endforeach; ?>
    		
    		<?php if( $sql->count() == 0 ): ?>
    		<div class="btn-block text-center">
	    	<i class="icon-users ico-no-result"></i>
	    </div>
    		<h3 class="margin-top-none text-center no-result user-no-result">
	    	- <?php echo Lang::get('users.no_members_found'); ?> -
	    	</h3>
	    	<?php endif; ?>
	    	
	    	
    		<?php if( $sql->getLastPage() > 1 && $page <= $sql->getLastPage() ): ?>
    			    		
	    		<div class="btn-group paginator-style">
	        		<?php echo $sql->links(); ?> 
	        	</div>
	        	
    		
    		<?php endif; ?>
    		
 </div><!-- /COL MD -->
<?php $__env->stopSection(); ?>

<?php $__env->startSection('sidebar'); ?>
	<div class="col-md-4">
		<?php echo $__env->make('includes.ads', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
	</div>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>